<!DOCTYPE html>
<html lang="en">

  <head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>math对象</title>
  </head>

  <body>

  </body>
  <script>
    /* 
     数学对象
       1.Math.PI：圆周率
       2.Math.abs():绝对值
       3.Math.max()：最大值，参数是Number类型，否则是NaN
       4.Math.min():最小值，参数是Number类型，否则是NaN
       5.Math.round():四舍五入，取大
       6.Math.random():[0,1)之间的随机数
       7.Math.ceil();向上取整
       8.Math.floor():向下取整
     */
    console.log(Math.PI); //3.1415926
    console.log(Math.abs(-0.5)); //0.5
    console.log(Math.max(6, 10, -3)); //10
    console.log(Math.min(6, 10, -3)); //-3
    console.log(Math.round(-1.5)); //-1
    console.log(Math.random());
    console.log(Math.ceil(1.5)); //2
    console.log(Math.floor(1.5)); //1
  </script>

</html>